using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ObjectMapper.Benchmark.DataModel
{
    internal class ProductModelIllustrationConfiguration : EntityTypeConfiguration<ProductModelIllustration>
    {
        public ProductModelIllustrationConfiguration()
        {
            ToTable("Production.ProductModelIllustration");
            HasKey(x => new {x.ProductModelId, x.IllustrationId});

            Property(x => x.ProductModelId)
                .HasColumnName("ProductModelID")
                .IsRequired()
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);
            Property(x => x.IllustrationId)
                .HasColumnName("IllustrationID")
                .IsRequired()
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);
            Property(x => x.ModifiedDate).HasColumnName("ModifiedDate").IsRequired();
        }
    }
}